package com.heima.admin.controller.v1;

import com.heima.apis.wemedia.IWemediaClient;
import com.heima.model.admin.dtos.BhDto;
import com.heima.model.admin.dtos.ConnentDto;
import com.heima.model.admin.dtos.NewsDto;
import com.heima.model.admin.dtos.NewsTgDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmNewsDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author: liudehuan
 * @description
 * @date: 2023-04-25 14:55
 */
@RestController
@RequestMapping("/api/v1/news")
public class NewsController {

    @Autowired
    private IWemediaClient wemediaClient;

    @PostMapping("/list_vo")
    public ResponseResult getSensitiveList(@RequestBody NewsDto dto){
        ResponseResult newsList = wemediaClient.getNewsList(dto);
        return newsList;
    }

    @GetMapping("/one_vo/{id}")
    public ResponseResult getNewsContent(@PathVariable Integer id){
        return wemediaClient.getNewsContent(id);
    }

    @PostMapping("/auth_fail")
    public ResponseResult BoHui(@RequestBody BhDto dto){
        return wemediaClient.boHui(dto);
    }

    @PostMapping("/auth_pass")
    public ResponseResult passAuth(@RequestBody NewsTgDto dto){
        return wemediaClient.newsTg(dto);
    }

}
